import { request } from '@/utils/http'
/**
 * 试卷管理
 */
export default {
  create: data => request.post('/paper', data),
  update: data => request.put(`/paper/${data.id}`, data),
  list: (params = {}) => request.get('/paper', { params }),
  getById: id => request.get(`/paper/${id}`),


  cartRemove: (id) => request.put(`/cart/remove?itemId=${id}`), //题蓝移除
  cartResort: (data) => request.put('/cart/reSort', data),  // 题蓝排序
  cartConfiguration: (id, data) => request.put(`/cart/configuration/${id}`, data),
  cartAddIn: (data) => request.put(`/cart/addIn`, data), //题蓝添加
  cartSave: (id) => request.post(`/cart/save?snapshotId=${id}`), // 组卷保存 
  getCartInfo: (params) => request.post('/cart/info', null, { params }), // 组卷查询
  cartSummary: (params) => request.post('/cart/summary', null, { params }), // 组卷查询

  getCartById: (id) => request.get(`/cart/${id}`), // 根据ID查询卷子
  cartDelete: id => request.delete(`/cart/${id}`),  // 组卷删除
  getPaperRecode: (params = {}) => request.get('/cart/record', { params }), // 组卷记录
  exportPaper: (id) => request.get(`/cart/poi-tl/${id}`, {
    responseType: 'blob', // 指定响应类型为blob
    headers: {
      'Accept': '*/*'
    }
  }),
  getPapers: (params) => request.get('/paper', { params }), // 所有导入试卷

}
